package example56789;

//定义Animal类
class Animal5{
    String name="牧羊犬";
    void shout(){
        System.out.println("动物发出的叫声");
    }
}
class Dog extends Animal5{
    public void shout(){
        super.shout();
        System.out.println("汪汪汪······");
    }
    public void printName(){
        System.out.println("名字："+super.name);
    }
}
public class c5 {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.shout();
        dog.printName();
    }
}
